<?php
/**
 * Created by PhpStorm.
 */

use Biz\service\activity\Coupon as sCoupon;
use Biz\tools\GoodsExposureLog;

/**
 * @deprecated
 */
class GoodsListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_VISITOR;
    const ACTION_TYPE = "coupon";

    public function main()
    {
        $couponId = $this->getRequest()->getQuery('coupon_id', 0);
        $sortType = $this->getRequest()->getQuery('sort_type', 0);
        $provinceId = $this->getRequest()->getQuery('province_id', 0);
        $page = $this->getRequest()->getQuery('page', 1);
        $cityId = $this->getRequest()->getQuery('city_id', 0);
        $areaCode = $cityId ? $cityId : $provinceId;

        $result = sCoupon::getGoodsList($couponId, $sortType, $areaCode, $page);

        $this->setSuccess($result);
        GoodsExposureLog::addLog($this->getRequest(), $result,$couponId);
    }

}
